package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.MerchantRechargePayment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.stereotype.Repository;

import javax.persistence.LockModeType;

/**
 * Created by hone on 17-3-29.
 */
@Repository
public interface MerchantRechargePaymentRepository extends JpaRepository<MerchantRechargePayment, Long>, JpaSpecificationExecutor {

    @Lock(value = LockModeType.PESSIMISTIC_WRITE)
    MerchantRechargePayment getById(Long id);

    MerchantRechargePayment findBySerialNum(String payNo);
}
